import { createApp } from 'vue'
import App from './App.vue'


import {createRouter, createWebHistory} from 'vue-router'
import HomePage from './views/vue/Home.vue'
import AboutPage from './views/vue/About.vue'
import HelloWorld from './components/HelloWorld.vue'
import axios from 'axios'

import store from './views/store'

axios.defaults.baseURL='http://localhost:8001'

const app = createApp(App)

app.config.globalProperties.$http=axios

// 创建路由实例
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {path: '/home',component: HomePage},
        {path: '/about/:id',name: 'about', component: AboutPage},
        {path: '/helloWorld', component: HelloWorld},
    ],
})
//  将路由实例添加到应用程序中
app.use(router);
// 将vuex添加到应用程序 中
app.use(store);
//  挂载应用程序到DOM元素
app.mount('#app');




// createApp(App).mount('#app')
